package com.zbkj.common.model.device;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * MQTT配置实体类
 * +----------------------------------------------------------------------
 * | Author: xiaolic
 * +----------------------------------------------------------------------
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("zfb_mqtt_config")
@ApiModel(value="MqttConfig对象", description="MQTT配置信息")
public class MqttConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "配置ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "实例ID")
    private String instanceId;

    @ApiModelProperty(value = "设备的ClientID")
    private String clientId;

    @ApiModelProperty(value = "分组ID")
    private String groupId;

    @ApiModelProperty(value = "订阅主题ID")
    private String topicId;

    @ApiModelProperty(value = "MQTT服务地址")
    private String mqttServerUrl;

    @ApiModelProperty(value = "用户身份密钥")
    private String accessKey;

    @ApiModelProperty(value = "消息加密密钥")
    private String secretKey;

    @ApiModelProperty(value = "客户端直连用户名")
    private String connUsername;

    @ApiModelProperty(value = "客户端直连密码")
    private String connPassword;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedAt;

    @ApiModelProperty(value = "是否删除:0否,1是")
    @TableLogic
    private Boolean isDeleted;

    @ApiModelProperty(value = "设备SN编号")
    @TableField(exist = false)
    private String deviceSN;
}
